colorplane: Remove (un)realize handlers
authorTimm Bäder <mail@baedert.org>
Sat, 26 Sep 2020 08:00:34 +0000 (10:00 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 14 Oct 2020 19:06:12 +0000 (15:06 -0400)
Creating the texture in realize() is unnecessary these days, since we
can just rely on size_allocate to do that.

gtk/gtkcolorplane.c

index fa08611111e540b3abe1340b12b49ade238b2323..a6fa75c795da3eea116a57fb1fd60519fbdfe020 100644 (file)
@@ -183,24 +183,6 @@ plane_size_allocate (GtkWidget *widget,
   create_texture (widget);
 }
 
-static void
-plane_realize (GtkWidget *widget)
-{
-  GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->realize (widget);
-
-  create_texture (widget);
-}
-
-static void
-plane_unrealize (GtkWidget *widget)
-{
-  GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
-
-  g_clear_object (&plane->texture);
-
-  GTK_WIDGET_CLASS (gtk_color_plane_parent_class)->unrealize (widget);
-}
-
 static void
 set_cross_cursor (GtkWidget *widget,
                   gboolean   enabled)
@@ -502,8 +484,6 @@ gtk_color_plane_class_init (GtkColorPlaneClass *class)
 
   widget_class->snapshot = plane_snapshot;
   widget_class->size_allocate = plane_size_allocate;
-  widget_class->realize = plane_realize;
-  widget_class->unrealize = plane_unrealize;
 
   g_object_class_install_property (object_class,
                                    PROP_H_ADJUSTMENT,